<?php require_once('../../core/import.php');?>
<?php User::Permission('INTERVIEW_LIST'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/checkbox/import.checkbox.js"></script>
    <script type="text/javascript" src="../../scripts/components/zebra_table/import.zebra_table.js"></script>
    <script type="text/javascript" src="scripts/list.js"></script>
</head>

<body>   
    <table width="98%" id="List" border="0" cellpadding="0" cellspacing="0" class="List">
    <thead>    
    <tr>
        <th width="2%" height="25" align="center" valign="middle">选</th>
        <th width="65%" align="left" valign="middle">&nbsp;标题</th>
        <th width="18%" align="center" valign="middle">采访嘉宾</th>
        <th width="8%" align="center" valign="middle">发布时间</th>
        <th width="7%" align="center" valign="middle">操作选项</th>
    </tr>
    </thead>    
    <tbody>
    <form id="Form1" name="Form1" method="post" action="list.action.batch_delete.php">
	<?php
		#获取数据
		$Keyword=Functions::HttpArgs('Keyword');
		$Wheres="where 1=1 ";
		if($Keyword){
			$Wheres=$Wheres." and Title like '%$Keyword%' ";
		}
		$Orders=$Wheres.'order by ID desc';	
		$Data=DB::GetData('select * from `interview` '.$Orders.' limit ?,15');
		foreach($Data['Record'] as $Row)
		{
    ?>
    <tr>
        <td height="25" align="center" valign="middle">
            <input id="ID" name="ID[]" type="checkbox" value="<?php echo $Row['ID']; ?>" class="Cursor_Pointer" />
        </td>
        <td height="25" valign="middle">
            <?php 
	  	$Title_Len=50;
		if($Row['M_IsTop'])
			{
				echo '<font color="green">[置顶]</font>';
				$Title_Len=$Title_Len-4;
			}
		if($Row['M_IsCurrent'])
			{
				echo '<font color="orange">[本期嘉宾]</font>';
				$Title_Len=$Title_Len-6;
			}
	   ?>
            &nbsp;<a href="edit.php?id=<?php echo $Row['ID']; ?>"><?php echo Functions::SubStr($Row['Title'],$Title_Len); ?></a>
        </td>
        <td height="25" align="center" valign="middle"><?php echo $Row['Name']; ?></td>
        <td height="25" align="center" valign="middle">
            <?php echo date('Y-m-d',strtotime($Row['Datetime']));?>
        </td>
        <td height="25" align="center" valign="middle">
            <a href="edit.php?id=<?php echo $Row['ID']; ?>">编辑</a>
            <a href="javascript:mconfirm_delete('list.action.delete.php?id=<?php echo $Row['ID']?>');">删除</a>
        </td>
    </tr>
    <?php
        }
    ?>
    </form>
    </tbody>    
    <tfoot>
    <tr>
        <td height="25" colspan="5" align="center" valign="middle">
            <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="55%" height="19" align="left">
                <?php
                    PagerFactory::Create('Simple')->Display($Data,array
			  (
			  	'Parameters'=>array(
					'Keyword'=>$Keyword,
				)
				
			  ));
                ?>
                </td>
                <td width="45%" align="right">
                    <span id="SelectAll" class="Cursor_Pointer">全选</span>/<span id="UnSelectAll" class="Cursor_Pointer">全不选</span>
                    选中项：<span id="Delete" class="Cursor_Pointer">删除</span>
                    <span id="IsTop" class="Cursor_Pointer"><font color="green">置顶</font></span>        
                </td>
            </tr>
            </table>    
         </td>
	</tr>
    </tfoot>    
    </table>
</body>
</html>